package de.baumann.browser.present

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.Actives
import de.baumann.browser.model.AppConfigModel
import de.baumann.browser.utils.ActiveUtil

class AppConfigPresenter {

    fun getActiveConfig() {
        AppConfigModel()
                .getActiveConfig().subscribe(object : OdinObserver<Actives>() {
                    override fun onSuccess(data: Actives) {
                        ActiveUtil.putSuperNodeStatus(data.superNode == 1)
                        ActiveUtil.putBlackCardStatus(data.blackCard == 0)
                        ActiveUtil.putPoolStatus(data.pool == 0)
                    }
                })
    }
}